/**
 * Copyright (C) 2011 Daniel Centore
 * 
 * This file is part of WriteIn.
 *
 * WriteIn is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * WriteIn is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with WriteIn.  If not, see <http://www.gnu.org/licenses/>.
 *  
 */
package in.write.main;

import in.write.data.stored.PreferenceManager;
import in.write.gui.Gui;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 * Main entry point for our program
 * 
 * @author Daniel Centore
 * 
 */
public class Main
{
	public static final int DEFAULT_RESOLUTION = 72; // 72 pixels/inch

	public static final double DEFAULT_WIDTH = 8.5;
	public static final double DEFAULT_HEIGHT = 11;

	public static void main(String[] args)
	{
		System.out.println();

		if (PreferenceManager.getInt(PreferenceManager.RESOLUTION) <= 0)
			PreferenceManager.putInt(PreferenceManager.RESOLUTION, DEFAULT_RESOLUTION);

		if (PreferenceManager.getDouble(PreferenceManager.DEFAULT_WIDTH) <= 0)
		{
			PreferenceManager.putDouble(PreferenceManager.DEFAULT_WIDTH, DEFAULT_WIDTH);
			PreferenceManager.putDouble(PreferenceManager.DEFAULT_HEIGHT, DEFAULT_HEIGHT);
		}

		new Gui().setVisible(true);
	}

}
